<?
$r = "../";
require_once($r."_inc/url_loader.php");
require_once($r."_config/sms.php");
require_once($r."_inc/text.php");

error_reporting(0);

// set SMS message text
$text = $g_text_test_sms_default;
if ($_POST["text"]) $text = $_POST["text"];
else if ($_GET["text"]) $text = $_GET["text"];

// set SMS destination number
$number = $sms_test_number;
if ($_POST["number"]) $number = $_POST["number"];
else if ($_GET["number"]) $number = $_GET["number"];


$url = "http://api.clickatell.com/http/sendmsg?".
		"user=".$sms_username.
		"&password=".$sms_password.
		"&api_id=".$sms_api_id.
		"&text=".$text.
		"&to=".$number;
$options = array(
	'return_info'	=> true,
	'method'		=> 'post'
);

//make HTTP request to Clickatell
$result = load($url, $options);

// if Clickatell returns ID than message sent successfuly
if (strpbrk($result['body'], "ID: ")) echo $g_text_test_sms_sent;
else echo $g_text_test_sms_error;

?>